<?php
/**
 * Data model
 *
 * @category  DataModel
 * @package   DataModel
 * @author    DataModel Generator v1.3
 * @version   Revision: $Rev$
 */
/**
 * Data model for table "phpdoc_file"
 *
 * @category  DataModel
 * @package   DataModel
 * @author    DataModel Generator v1.3
 * @version   Revision: $Rev$
 *
 * @property-read mixed Id
 * @property-read mixed FolderId
 * @property-read mixed Source
 * @property-read mixed Name
 * @property-read mixed BuildId
 * @property-read mixed New
 */
abstract class BasePhpdocFile extends BaseRecord
{
    const TABLE_NAME = "phpdoc_file";

    public function __construct()
    {
        parent::__construct(self::TABLE_NAME);
    }

    protected function initFields()
    {
        $this->hasColumn('id', 'PUA:int(10)');
        $this->hasColumn('folder_id', 'U:int(10)');
        $this->hasColumn('source', 'longtext');
        $this->hasColumn('name', 'varchar(255)');
        $this->hasColumn('build_id', 'U:int(10)');
        $this->hasColumn('new', 'tinyint(1)');
    }

    public function initRelations()
    {
        $this->addRelation('PhpdocFolder', new ORMRelationOne2One('PhpdocFolder','folder_id','id'));
    }

    public function getById($id)
    {
        return parent::getById($id, 'PhpdocFile');
    }

    public function getByParams( $params, $type = ORMRecord::ONE_RECORD, $limit = null )
    {
        return parent::getByParams( $params, $type, $limit, 'PhpdocFile');
    }

    public function getAll( $limit = null )
    {
        return parent::getAll( $limit, 'PhpdocFile' );
    }
}